package com.bos.controller;

import com.bos.data.model.BosProjectModel;
import com.bos.data.model.BusinessModel;
import com.bos.data.model.PerformanceModel;
import com.bos.data.model.SituationModel;
import com.bos.service.PerformanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * create by tanghuihong 2018/6/13
 */
@Controller
public class PerformanceController {
    @Autowired
    @Qualifier("situationServiceImpl")
    PerformanceService situationService;
    @RequestMapping(value = "/toname/{id}")
    public String findname(Model model, @PathVariable("id") int id) {
        //查询出整体情况，实施情况，商务情况(根据项目表id查询其他三个表中的数据)
       BosProjectModel bosProjectModel  =situationService.findProjectDetails(id);
       PerformanceModel performanceModel=situationService.findPerformances(id);
       BusinessModel    businessModel   =situationService.findBuiness(id);
       model.addAttribute("projectDetail",bosProjectModel);
       model.addAttribute("performance",performanceModel);
       model.addAttribute("buiness",businessModel);
        return "NameDetail";
    }
}
